package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbTotalExpenditureDao;
import com.xhs.main.entity.cwb.CwbTotalExpenditure;
import com.xhs.main.service.cwb.CwbTotalExpenditureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * create by ljw on 2020/10/16
 */
@Service
public class CwbTotalExpenditureServiceImpl implements CwbTotalExpenditureService {

    @Autowired
    CwbTotalExpenditureDao cwbTotalExpenditureDao;

    @Override
    public void addCwbTotalExpenditure(CwbTotalExpenditure cwbTotalExpenditure) {
        cwbTotalExpenditureDao.insertCwbTotalExpenditure(cwbTotalExpenditure);
    }

    @Override
    public List<CwbTotalExpenditure> getAllCwbTotalExpenditure() {
        List<CwbTotalExpenditure> cwbTotalExpenditures = cwbTotalExpenditureDao.selectAllCwbTotalExpenditure();
        return cwbTotalExpenditures;
    }

    @Override
    public CwbTotalExpenditure getOneByID(Integer cwbTId) {
        CwbTotalExpenditure cwbTotalExpenditure = cwbTotalExpenditureDao.selectOneByID(cwbTId);
        return cwbTotalExpenditure;
    }

    @Override
    public Double selectAllMoney() {
        Double money = cwbTotalExpenditureDao.selectAllMoney();
        return money;
    }
}
